﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TicketsPhone.Domain.Access
{
    /// <summary>
    /// Represents the interaction with a repository of information
    /// its implementation can perform actions on data repository
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IConsultasBase<T>
    {
        /// <summary>
        /// gets a value indicating whether the action to run this on transactional
        /// </summary>
        bool Transaccion { get; set; }

        /// <summary>
        /// gets or sets the object for the class
        /// </summary>
        T Objeto { get; set; }

        /// <summary>
        /// Moves the cursor to the next record
        /// </summary>
        /// <returns></returns>
        bool Read();

        /// <summary>
        /// Gets the column located in the specified index
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        object GetValue(string name);

        /// <summary>
        /// Gets the column with the specified name
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        object GetValue(int index);

        /// <summary>
        /// Executes the transact-sql against the connection data by returning the number of rows affected
        /// </summary>
        /// <returns></returns>
        int ExecuteNonQuery();

        /// <summary>
        /// Executes the transact-sql against the connection data by returning the first column of the firs rows in the results
        /// </summary>
        /// <returns></returns>
        object ExecuteScalar();

        /// <summary>
        /// Send the Command property and creates a object Datareader
        /// </summary>
        void ExecuteReader();

        /// <summary>
        /// Confirms the transaction in the data base
        /// </summary>
        void Commit();

        /// <summary>
        /// Rolls back the transaction in the data base
        /// </summary>
        void RollBack();

        /// <summary>
        /// Opens the connection to the data base
        /// </summary>
        void Open();

        /// <summary>
        /// Closes the connection to the data base
        /// </summary>
        void Close();

        ///////// <summary>
        ///////// Inserts in the data base a new object model
        ///////// </summary>
        ///////// <returns></returns>
        //////object Insertar();

        ///////// <summary>
        ///////// Updates the object in the data base
        ///////// </summary>
        //////void Actualizar();

        ///////// <summary>
        ///////// Deletes the object in the data base
        ///////// </summary>
        //////void Eliminar();

        ///////// <summary>
        ///////// Load an objet from the data base
        ///////// </summary>
        //////void Cargar();

        ///////// <summary>
        ///////// Gets a collection´s object from the data base
        ///////// </summary>
        ///////// <returns></returns>
        //////List<T> ObtenerTodos();
    }
}
